import request from '@/utils/request.js'

// 查询供货商列表
export function listSupplier(query) {
  return request({
    url: '/system/supplier/list',
    method: 'get',
    params: query
  })
}

// 查询我的供货商列表
export function mySupplierList() {
  return request({
    url: '/system/supplier/myList',
    method: 'get'
  })
}

// 查询所有供货商（不分页）
export function listAllSupplier() {
  return request({
    url: '/system/supplier/listAll',
    method: 'get'
  })
}

// 查询供货商详情
export function getSupplier(supplierId) {
  return request({
    url: '/system/supplier/get/' + supplierId,
    method: 'get'
  })
}

// 新增供货商
export function addSupplier(data) {
  return request({
    url: '/system/supplier',
    method: 'post',
    data: data
  })
}

// 修改供货商
export function updateSupplier(data) {
  return request({
    url: '/system/supplier',
    method: 'put',
    data: data
  })
}

// 删除供货商
export function delSupplier(supplierId) {
  return request({
    url: '/system/supplier/' + supplierId,
    method: 'delete'
  })
}